﻿@model PagedList.IPagedList<SDSystem.Models.Restaurant>
@{
    ViewBag.Title = "RestaurantPage";
    Layout = "~/Views/Shared/_LayoutSite.cshtml";
}


@foreach(var item in Model)
{
    <div class="row">
        <div class="span8" style="margin-bottom: 10px"><h3>@Html.ActionLink(item.Name, "RestaurantDetail", new { id = item.RestaurantId })</h3>
            <div class="row">
                <div class="span4"><img src=@Html.DisplayFor(m => item.Image) alt="photo1"/></div>
                <div class="row">
                    <div class="span4">@Html.Raw(item.Description)</div>
                    <div class="span4">
                        <i class="icon-map-marker"></i>Địa chỉ:@Html.DisplayFor(m => item.Street),@Html.DisplayFor(m => item.City)
                    </div>
                    <div class="span1 offset3"><u>@Html.ActionLink("Chi tiết...", "RestaurantDetail", new { id = item.RestaurantId })</u></div>
                </div>
            </div>
        </div>
        <div class="span8" style="height: 1px;background-color: gainsboro"></div>
    </div>
}
<div class="span3 offset5">
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount
     
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "RestaurantPage", new { page = 1 })
        @Html.Raw(" ");
        @Html.ActionLink("< Prev", "RestaurantPage", new { page = Model.PageNumber - 1 })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev
    }
     
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Next >", "RestaurantPage", new { page = Model.PageNumber + 1 })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "RestaurantPage", new { page = Model.PageCount })
    }
    else
    {
        @:Next >
        @Html.Raw(" ")
        @:>>
    }
</div>